package com.jhgk.jhcee.system.service;

import com.jhgk.jhcee.common.domain.UserModel;
import com.jhgk.jhcee.common.resultful.BasisResultful;
import com.jhgk.jhcee.data.auth.entity.SysUserInfo;
import com.jhgk.jhcee.system.domain.model.SysUserInfoModel;
import com.jhgk.jhcee.system.domain.model.SysUserLoginParam;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: xiezhongping
 * @description:
 * @date: 2021/8/16 14:35.
 */
public interface SysUserInfoService {

    BasisResultful<UserModel> loadUserByUsername(String username);

    /**
     * 获取当前用户信息
     */
    BasisResultful<SysUserInfo> getCurrentUser();

    /**
     * 注册
     */
    @Transactional
    BasisResultful<SysUserInfo> register(SysUserInfo sysUserInfo);

    BasisResultful<Object> getInfo();

    BasisResultful<Object> login(SysUserLoginParam sysUserLoginParam);

    BasisResultful<Object> userList(SysUserInfoModel model);

    /**
     * 账户是否存在
     */
    BasisResultful<Object> isAccountExist(String username);

    @Transactional
    BasisResultful<Object> updateUser(SysUserInfoModel model);

    @Transactional
    BasisResultful<Object> deleteUser(Long userId);

    @Transactional
    BasisResultful<Object> addUser(SysUserInfoModel model);

    @Transactional
    BasisResultful<Object> setUserStatus(Long userId, Integer status);
}
